﻿using System;
using System.ComponentModel;
using System.Web.UI.WebControls.WebParts;

namespace ShareDev.Webparts
{
    [ToolboxItemAttribute(false)]
    public partial class FAQs : WebPart
    {
        // Uncomment the following SecurityPermission attribute only when doing Performance Profiling using
        // the Instrumentation method, and then remove the SecurityPermission attribute when the code is ready
        // for production. Because the SecurityPermission attribute bypasses the security check for callers of
        // your constructor, it's not recommended for production purposes.
        // [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Assert, UnmanagedCode = true)]
        public FAQs()
        {
        }

        /// <summary>
        /// Webparts customizables properties
        /// </summary>
        /// 

        #region Webparts customizations

        [Category("Custom properties")]
        [DisplayName("FAQ title")]
        [Description("FAQ title to exibe in header.")]
        [Browsable(true)]
        public string _title = string.Empty;
        public string Title
        {
            get
            {
                return _title;
            }
            set
            {
                _title = value;
            }
        }

        #endregion

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            InitializeControl();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (_title == string.Empty)
            {
                lblTitle.Text = "(empty title)";
                lblTitle.ForeColor = System.Drawing.Color.Red;
            }
            else
                lblTitle.Text = _title;
        }
    }
}
